package br.edu.utfpr.backupTools.view.action.backup;

import br.edu.utfpr.backupTools.model.pojo.Backup;
import br.edu.utfpr.backupTools.util.enums.TipoConexao;
import br.edu.utfpr.backupTools.view.action.AbstractCommand;
import br.edu.utfpr.backupTools.view.action.strategy.impl.GerarRestoreLocal;
import br.edu.utfpr.backupTools.view.action.strategy.impl.GerarRestoreRemoto;
import br.edu.utfpr.comum.RetornoValidacao;

public class GerarRestore extends AbstractCommand<Backup>{
	
	@Override
	public RetornoValidacao execute(Backup bean) {
		gerarRestore = bean.getTipoConexao().equals(TipoConexao.LOCAL) ? new GerarRestoreLocal() : new GerarRestoreRemoto();
		return gerarRestore.gerarRestore(bean);
	}

}
